Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Diff of /sqlitebrowser3/mainobject.cpp [048f54] .. [3a4e2a] Maximize Restore

  Switch to side-by-side view

--- a/sqlitebrowser3/mainobject.cpp
+++ b/sqlitebrowser3/mainobject.cpp
@@ -1,7 +1,7 @@
 
 #include <QtCore/QCoreApplication>
 #include "mainobject.h"
-//#include "launcher/launcherwidget.h"
+#include "launcher/launcherwidget.h"
 
 
 //****************************************************************************
@@ -10,67 +10,59 @@
     : QObject(parent)
 {
 
+    //** TODO somehow check here id the CMD args are sane
+    // database exists and open a windows eg
+    // sqlitebrowser3-dev --test.db
+    // if (camnd_arg_database_is_sane)
 
-    settings = new QSettings(this);
+
+
+    settings = new XSettings(this);
 
 
     //***********************************
     //** Tray Icon
-    trayIcon = new QSystemTrayIcon(QIcon(":/icons/index"), this);
+    trayIcon = new QSystemTrayIcon(QIcon(":/icons/favicon"), this);
     trayIcon->setToolTip("sqlitebrowser-3-dev-version");
     trayIcon->setVisible(true);
     connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
             this, SLOT(on_tray_icon(QSystemTrayIcon::ActivationReason)));
 
+    //***********************************
+    //** Tray PopupMenu and actions
+    popupMenu = new QMenu();
+    trayIcon->setContextMenu(popupMenu);
 
-    //** TODO somehow check here id the CMD args are sane
-    // database exists and open a windows eg
-    // sqlitebrowser3-dev --test.db
-    // if (camnd_arg_database_is_sane)
+    actionQuit = new QAction(popupMenu);
+    actionQuit->setIcon(QIcon(":/icons/quit"));
+    actionQuit->setText(tr("Quit"));
+    popupMenu->addAction(actionQuit);
+    connect(actionQuit, SIGNAL(triggered()), this, SLOT(on_quit()));
 
-    //else
+    trayIcon->show();
 
+    show_launcher();
 
-    //*********************************************************
-    // Launcher Window/Widget
-    //TODO.. should this be ceated now and hidden
-    // maybe for now its hows but if a command arg is there
-    // then this should "not initialse" or create object instead popup window.
-
-
-    //** initialise and show the monster widget//
-    launcherWidget = new LauncherWidget(this);
-    launcherWidget->show();
 
 
 }
 
-/*
-void MainObject::on_launcher()
-{
-    // initialise and show the monster widget//
-    launcherWidget = new LauncherWidget();
+//** Show Main Launcher Widget
+void MainObject::show_launcher()
+{ 
+    LauncherWidget *launcherWidget = new LauncherWidget(this);
     launcherWidget->show();
+}
 
-    // delete launcherWIndow() ??
-}
-*/
 
 
 
 //****************************************************************************
 //** On Tray Icon
-void MainObject::on_tray_icon(QSystemTrayIcon::ActivationReason reason){
+void MainObject::on_tray_icon(QSystemTrayIcon::ActivationReason reason)
+{
+    Q_UNUSED(reason);
 
-    //* Right click will show the context Menu above system tray
-    //* Following will popup menu with single click on Top LEFT ??
-    //if(reason == QSystemTrayIcon::Trigger){
-     //   QPoint p = QCursor::pos();
-    //    trayIcon->contextMenu()->popup(p);
-   // }
-
-    //DEV MODE.. kills
-    this->on_quit();
 }
 
 
@@ -82,7 +74,7 @@
 
 
 //****************************************************************************
-//** Controlled Demolishion..
+//** Destructor
 MainObject::~MainObject()
 {