Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add sensible default for the window geometry.

  • Loading branch information...
commit 33dfe8f948bec3f685ae396ba07519d7c4254b23 1 parent 9eb5d14
@nickbnf authored
Showing with 13 additions and 1 deletion.
  1. +6 −0 crawlerwidget.cpp
  2. +7 −1 mainwindow.cpp
View
6 crawlerwidget.cpp
@@ -85,6 +85,12 @@ CrawlerWidget::CrawlerWidget(SavedSearches* searches, QWidget *parent)
addWidget(logMainView);
addWidget(bottomWindow);
+ // Default splitter position (usually overridden by the config file)
+ QList<int> splitterSizes;
+ splitterSizes += 400;
+ splitterSizes += 100;
+ setSizes( splitterSizes );
+
// Connect the signals
connect(searchLineEdit->lineEdit(), SIGNAL( returnPressed() ),
searchButton, SIGNAL( clicked() ));
View
8 mainwindow.cpp
@@ -48,6 +48,11 @@ MainWindow::MainWindow( QString fileName ) : fileWatcher( this ), mainIcon_()
setAcceptDrops( true );
+ // Default geometry
+ const QRect geometry = QApplication::desktop()->availableGeometry( this );
+ setGeometry( geometry.x() + 20, geometry.y() + 40,
+ geometry.width() - 140, geometry.height() - 140 );
+
// Initialize the file watcher
connect( &fileWatcher, SIGNAL( fileChanged( const QString& ) ),
this, SLOT( signalFileChanged( const QString& ) ) );
@@ -55,9 +60,10 @@ MainWindow::MainWindow( QString fileName ) : fileWatcher( this ), mainIcon_()
connect( this, SIGNAL( optionsChanged() ),
crawlerWidget, SLOT( applyConfiguration() ));
- // Is there a file passed as argument?
readSettings();
emit optionsChanged();
+
+ // Is there a file passed as argument?
if ( !fileName.isEmpty() )
loadFile( fileName );
else if ( !previousFile.isEmpty() )
Please sign in to comment.
Something went wrong with that request. Please try again.