Skip to content

Commit

Permalink
Merge branch '349-no-window'
Browse files Browse the repository at this point in the history
Enable no-window from GUI

Fixes #349
  • Loading branch information
szszszsz committed Jun 24, 2019
2 parents 5700c49 + d91ce36 commit 255b129
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 70 deletions.
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ int main(int argc, char *argv[]) {
w.set_debug_level(parser.value("debug-level").toInt());
}

if(parser.isSet("no-window")) {
if(parser.isSet("no-window") || !settings.value("main/show_on_start", true).toBool() ) {
w.hideOnStartup();
}

Expand Down
2 changes: 2 additions & 0 deletions src/ui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ void MainWindow::load_settings_page(){
ui->cb_show_main_window_on_connection->setChecked(settings.value("main/show_main_on_connection", true).toBool());
ui->cb_hide_main_window_on_connection->setChecked(settings.value("main/close_main_on_connection", false).toBool());
ui->cb_hide_main_window_on_close->setChecked(settings.value("main/hide_on_close", true).toBool());
ui->cb_show_window_on_start->setChecked(settings.value("main/show_on_start", true).toBool());

ui->cb_check_symlink->setChecked(settings.value("storage/check_symlink", false).toBool());
#ifndef Q_OS_LINUX
Expand Down Expand Up @@ -1831,6 +1832,7 @@ void MainWindow::on_btn_writeSettings_clicked()
settings.setValue("main/show_main_on_connection", ui->cb_show_main_window_on_connection->isChecked());
settings.setValue("main/close_main_on_connection", ui->cb_hide_main_window_on_connection->isChecked());
settings.setValue("main/hide_on_close", ui->cb_hide_main_window_on_close->isChecked());
settings.setValue("main/show_on_start", ui->cb_show_window_on_start->isChecked());

settings.setValue("storage/check_symlink", ui->cb_check_symlink->isChecked());

Expand Down
145 changes: 76 additions & 69 deletions src/ui/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<enum>QTabWidget::Rounded</enum>
</property>
<property name="currentIndex">
<number>1</number>
<number>4</number>
</property>
<property name="elideMode">
<enum>Qt::ElideNone</enum>
Expand Down Expand Up @@ -1287,84 +1287,87 @@
<property name="title">
<string>General</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_17">
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QVBoxLayout" name="verticalLayout_20">
<item>
<widget class="QCheckBox" name="cb_first_run_message">
<property name="text">
<string>Show first-run message</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cb_check_symlink">
<property name="text">
<string>Show warning when no partitions could be detected on Encrypted Volume (Linux only)</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cb_device_connection_message">
<property name="text">
<string>Show message about device's connection / disconnection</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cb_show_main_window_on_connection">
<property name="text">
<string>Show main window when device connects</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<widget class="QCheckBox" name="cb_first_run_message">
<property name="text">
<string>Show first-run message</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cb_show_window_on_start">
<property name="text">
<string>Show main window on start</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cb_check_symlink">
<property name="text">
<string>Show warning when no partitions could be detected on Encrypted Volume (Linux only)</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cb_device_connection_message">
<property name="text">
<string>Show message about device's connection / disconnection</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cb_show_main_window_on_connection">
<property name="text">
<string>Show main window when device connects</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cb_hide_main_window_on_connection">
<property name="text">
<string>Hide main window when device disconnects</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cb_hide_main_window_on_close">
<property name="text">
<string>Do not quit when the main window is closed</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_12">
<item>
<widget class="QCheckBox" name="cb_hide_main_window_on_connection">
<widget class="QLabel" name="label_28">
<property name="text">
<string>Hide main window when device disconnects</string>
</property>
<property name="checked">
<bool>true</bool>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Translation file (needs restart)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cb_hide_main_window_on_close">
<property name="text">
<string>Do not quit when the main window is closed</string>
</property>
<property name="checked">
<bool>true</bool>
<widget class="QComboBox" name="combo_languages">
<property name="accessibleName">
<string>Translation file (needs restart)</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_12">
<item>
<widget class="QLabel" name="label_28">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Translation file (needs restart)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="combo_languages">
<property name="accessibleName">
<string>Translation file (needs restart)</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
Expand Down Expand Up @@ -1642,6 +1645,7 @@
<tabstop>PWS_ButtonClose</tabstop>
<tabstop>PWS_ButtonSaveSlot</tabstop>
<tabstop>cb_first_run_message</tabstop>
<tabstop>cb_show_window_on_start</tabstop>
<tabstop>cb_check_symlink</tabstop>
<tabstop>cb_device_connection_message</tabstop>
<tabstop>cb_show_main_window_on_connection</tabstop>
Expand All @@ -1660,6 +1664,9 @@
<tabstop>writeGeneralConfigButton</tabstop>
<tabstop>generalCancelButton</tabstop>
<tabstop>tabWidget</tabstop>
<tabstop>secret_key_generated_len</tabstop>
<tabstop>randomSecretButton</tabstop>
<tabstop>btn_copyToClipboard</tabstop>
</tabstops>
<resources>
<include location="../../resources.qrc"/>
Expand Down

0 comments on commit 255b129

Please sign in to comment.