added option in preferences to show launcher again

master
shaina7837 2014-08-02 11:46:07 +05:30
parent 4ae7746b95
commit 755c23391e
4 changed files with 33 additions and 6 deletions

View File

@ -165,6 +165,9 @@ Preferences::Preferences(QWidget *parent) : QMainWindow(parent)
updateGUI();
RenderSettings::inst()->setColors(this->colorschemes[getValue("3dview/colorscheme").toString()]);
//launcher Settings
connect(this->launcherBox, SIGNAL(stateChanged(int)), SLOT(launcherSettings(int)));
}
Preferences::~Preferences()
@ -183,6 +186,14 @@ Preferences::~Preferences()
* @param widget The widget that should be shown when the action is triggered.
* This must be a child page of the stackedWidget.
*/
void
Preferences::launcherSettings(int state)
{
QSettings settings;
settings.setValue("launcher/checkboxState", state);
}
void
Preferences::addPrefPage(QActionGroup *group, QAction *action, QWidget *widget)
{

View File

@ -37,6 +37,7 @@ public slots:
void on_mdiCheckBox_toggled(bool);
void on_undockCheckBox_toggled(bool);
void on_checkNowButton_clicked();
void launcherSettings(int);
signals:
void requestRedraw() const;

View File

@ -27,7 +27,7 @@
<item>
<widget class="QStackedWidget" name="stackedWidget">
<property name="currentIndex">
<number>4</number>
<number>3</number>
</property>
<widget class="QWidget" name="page3DView">
<layout class="QVBoxLayout" name="verticalLayout_4">
@ -426,7 +426,16 @@
</widget>
<widget class="QWidget" name="pageFeatures">
<layout class="QGridLayout" name="gridLayout_2">
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
@ -464,7 +473,7 @@
<x>0</x>
<y>0</y>
<width>803</width>
<height>325</height>
<height>332</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_10">
@ -475,6 +484,13 @@
</property>
</layout>
</item>
<item>
<widget class="QCheckBox" name="launcherBox">
<property name="text">
<string>Show Launcher.</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">

View File

@ -574,13 +574,12 @@ int gui(vector<string> &inputFiles, const fs::path &original_path, int argc, cha
MainWindow *mainwin = new MainWindow(assemblePath(original_path, inputFiles[0]));
#endif
if(set == true)
mainwin->launcher->show();
mainwin->launcher->show();
QSettings settings;
int s = settings.value("launcher/checkboxState").toInt();
if(s == 0)
mainwin->launcher->hide();
app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()));
int rc = app.exec();
if (MainWindow::windows) {