summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Zurek <pierrezurek@gmail.com>2014-02-25 17:36:51 +0100
committerTanu Kaskinen <tanu.kaskinen@linux.intel.com>2014-03-07 16:04:32 +0200
commitdc4bdf091f5fbd4540436d721094a782ed836b85 (patch)
tree6e2c2d312f3b8004f673d3b66525f7663adbdac2
parent35e844d2b2cf35f5a4cb29b1e32f4f1fa95dda7b (diff)
Add a --maximize command line option
-rw-r--r--src/mainwindow.cc4
-rw-r--r--src/mainwindow.h2
-rw-r--r--src/pavucontrol.cc9
3 files changed, 12 insertions, 3 deletions
diff --git a/src/mainwindow.cc b/src/mainwindow.cc
index fc378c4..5a42318 100644
--- a/src/mainwindow.cc
+++ b/src/mainwindow.cc
@@ -137,7 +137,7 @@ MainWindow::MainWindow(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>
connectingLabel->show();
}
-MainWindow* MainWindow::create() {
+MainWindow* MainWindow::create(bool maximize) {
MainWindow* w;
Glib::RefPtr<Gtk::Builder> x = Gtk::Builder::create();
x->add_from_file(GLADE_FILE, "liststore1");
@@ -146,6 +146,8 @@ MainWindow* MainWindow::create() {
x->add_from_file(GLADE_FILE, "liststore4");
x->add_from_file(GLADE_FILE, "mainWindow");
x->get_widget_derived("mainWindow", w);
+ if (w && maximize)
+ w->maximize();
return w;
}
diff --git a/src/mainwindow.h b/src/mainwindow.h
index 8f779b3..5c501f7 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -37,7 +37,7 @@ class RoleWidget;
class MainWindow : public Gtk::Window {
public:
MainWindow(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& x);
- static MainWindow* create();
+ static MainWindow* create(bool maximize);
virtual ~MainWindow();
void updateCard(const pa_card_info &info);
diff --git a/src/pavucontrol.cc b/src/pavucontrol.cc
index 72ec980..c1019b6 100644
--- a/src/pavucontrol.cc
+++ b/src/pavucontrol.cc
@@ -664,6 +664,13 @@ int main(int argc, char *argv[]) {
entry2.set_description(_("Retry forever if pa quits (every 5 seconds)."));
group.add_entry(entry2, retry);
+ bool maximize = false;
+ Glib::OptionEntry entry3;
+ entry3.set_long_name("maximize");
+ entry3.set_short_name('m');
+ entry3.set_description(_("Maximize the window."));
+ group.add_entry(entry3, maximize);
+
options.set_main_group(group);
try {
@@ -671,7 +678,7 @@ int main(int argc, char *argv[]) {
ca_context_set_driver(ca_gtk_context_get(), "pulse");
- MainWindow* mainWindow = MainWindow::create();
+ MainWindow* mainWindow = MainWindow::create(maximize);
pa_glib_mainloop *m = pa_glib_mainloop_new(g_main_context_default());
g_assert(m);